import 'package:flutter/material.dart';

/*
 * @author: ZhongWb
 * @date: 2019/1/21 15:55
 * @description 按钮
 * @description widget不文科则为纯自定义，不为空 则 为 风格1和2 ，风格1为边框按钮，风格2为无边框纯色按钮
 * */

/*
//示例:
ButtonText(
  type:1,
  text:"按钮",
  onTap: (){
    print("按钮");
  },
),
*/
Widget ButtonText({int type,TextStyle style,Color brColor:Colors.blue,String text,double circular,Widget widget,GestureTapCallback onTap}){
 Color bg = Color(0xFF3D7ADD);
  return InkWell(
   child: widget ?? Container(
     height: 32,
     padding: EdgeInsets.only(left: 15,right: 15),
     alignment: Alignment.center,
     decoration: BoxDecoration(
         color: type==1?Colors.transparent:brColor,
         border: Border.all(color: type!=1?Colors.transparent:brColor),
         borderRadius: BorderRadius.circular(circular ?? 10)
     ),
     child: Text(text??"我是按钮",style:style ?? TextStyle(color: type==1?Colors.blue:Colors.white),),
   ),
   onTap:onTap,
 );
}